
import { createRouter, createWebHistory } from "vue-router";

import type { App } from "vue";
import LayoutView from "../views/layout/LayoutView.vue";
import HomeView from "../views/home/HomeView.vue";
import ResidentView from "../views/resident/ResidentView.vue"


import Pending from "../views/CoManagement/Pending/pending.vue";//待处理签约
import SearchSon from "../views/CoManagement/pending/SearchSon.vue";//签约处理详情
import Redact from "../views/CoManagement/pending/redact.vue";//签约处理编辑

import Record from "../views/CoManagement/Record/record.vue";//签约记录
import Recorddetails from "../views/CoManagement/Record/Recorddetails.vue";//签约记录签约详情
import Redactdetails from "../views/CoManagement/Record/redactdetails.vue";//签约记录编辑



import Pendings from "../views/serve/pendings/pendings.vue";//待处理服务
import Records from "../views/serve/records/records.vue";//编辑服务处理
import Searchsons from "../views/serve/pendings/searchsons.vue";//服务详情


import Redacts from "../views/serve/pendings/redacts.vue";//服务记录
import Servicedetails from "../views/serve/records/Servicedetails.vue";//服务记录详情页
// import Addpending from "../views/serve/pendings/addpending.vue";




const routes = [
    // 重定向
    { path: '/', redirect: '/admin/index' },
    {
        // 布局页的路由
        path: '/admin/',
        component: LayoutView,
        name: 'LayoutView',
        // redirect: '/admin/index',
        children: [
            {
                path: '/admin/index',
                component: HomeView,
            },
            {
                path: '/admin/user/list',
                component: ResidentView,
            },
            {
                path: '/admin/CoManagement/pending', //待处理签约路由
                component: Pending,
            },
            {
                path: '/admin/CoManagement/SearchSon',//待处理查看详情跳转路由
                component: SearchSon,
            },
            {
                path: '/admin/CoManagement/Redact',//待处理编辑页面跳转路由
                component: Redact,
            },




            {
                path: '/admin/CoManagement/record',//签约记录路由
                component: Record,
            },
            {
                path: '/admin/CoManagement/Recorddetails',//签约记录详情跳转路由
                component: Recorddetails,
            },
            {
                path: '/admin/CoManagement/Redactdetails',//签约记录续约跳转路由
                component: Redactdetails,
            },




            {
                path: '/admin/serve/pendings', //待处理服务路由
                component: Pendings,
            },
            // {
            //     path: '/admin/serve/Addpending', //待处理新增页面
            //     component: Addpending,
            // },
            {
                path: '/admin/serve/Searchsons',//查看服务详情跳转路由
                component: Searchsons,
            },
            {
                path: '/admin/serve/Redacts',//编辑服务页面跳转路由
                component: Redacts,
            },





            {
                path: '/admin/serve/records',//服务记录路由
                component: Records,
            },
            {
                path: '/admin/serve/Servicedetails',//查看服务记录详情页面跳转路由
                component: Servicedetails,
            },
        ]
    },


    // { path: '/:pathMatch(.*)*', component: NotFound }
]

const router = createRouter({
    // 设置路由模式（history模式）
    history: createWebHistory(),
    // 配置路由对象（设置路径URL和组件之间的关联关系）
    routes: routes
})



export function registerRouter(app: App) {
    app.use(router);
}
